cmake_minimum_required(VERSION 3.5)
project(avoid_test VERSION 2.0.0)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(unitree_dir /opt/unitree_robotics)
set(unitree_include_dir ${unitree_dir}/include)
set(unitree_lib_dir ${unitree_dir}/lib)

find_package(Threads REQUIRED)

# Define the executable target first
add_executable(${PROJECT_NAME} hello_world.cpp)

# Add include directories after defining the target
target_include_directories(${PROJECT_NAME} PRIVATE
    ${unitree_include_dir}
    ${unitree_include_dir}/ddscxx
)

# Add link directories and libraries
target_link_directories(${PROJECT_NAME} PRIVATE ${unitree_lib_dir})

target_link_libraries(${PROJECT_NAME} 
    PRIVATE 
    unitree_sdk2
    Threads::Threads
)